<template>
  <div class="container">
    <div class="speed-up"
         v-if="doing_arr.length>0"
         v-for="(item, index) in doing_arr||[]"
         :key="index">
      <div class="code clearfix">
        <div class="left">补贴单号：{{item.applySn}}</div>
        <div class="right">第{{item.allowanceNumFormat}}期</div>
      </div>
      <div class="status">
        <!-- 进度条 -->
        <div class="progress">
          <div class="gray"></div>
          <div class="red"
               :style="{'width':(item.speedAchieve/item.allSpeedAchieve*100)+'%'}">
            <img :src="base_url+'/mp_3.1.1/bt/icon_tempo_money.png'"
                 class="rocket"
                 v-if="base_url"
                 alt="">
            <div class="current-total">
              {{item.speedAchieve}}
            </div>
          </div>
        </div>
        <div class="total">
          {{item.allSpeedAchieve}}
        </div>
      </div>
      <div class="detail">
        <p class="tip">您已分享 <span class="num">￥ {{item.speedAchieve}}</span></p>
        <p class="tip">仅需再分享 <span class="num"> ￥ {{item.allSpeedAchieve-item.speedAchieve}}</span> 即可完成提速</p>
      </div>
      <div class="btn"
           @click="to_beauty()">
        去提速
        <img :src="base_url+'/mp_3.1.1/bt/icon_gogogo.png'"
             class="icon"
             v-if="base_url"
             alt="">
      </div>
    </div>
    <div class="empty"
         v-if="!doing_arr||doing_arr.length==0">
      <img :src="base_url+'/mp_3.1.1/bt/bg_nothing.png'"
           v-if="base_url"
           alt=""
           class="img">
      <div class="msg">您还没有加速单哦</div>
    </div>
    <div class="rule">
      <div class="rule-title title1">
        提速卡权益规则
      </div>
      <p class="rule-section">
        1.提速卡权益由PLUS会员专享；
      </p>
      <p class="rule-section">2.分享好友消费≥本次补贴单金额，每成功分享1次，该PLUS会员下一期提现周期提速3期；若分享好友消费＜本次补贴单金额，可以继续分享好友购买医美项目，不限项目数量，直至分享好友消费≥本次补贴单金额；
      </p>
      <p class="rule-section">
        3.提速卡的使用不受医美补贴单笔数限制，每笔医美补贴单提现周期最多可累计提速36期；
      </p>
      <p class="rule-section">
        4.提速任务完成时间以手术完成时间确认补贴单结束为准，依次按手术完成时间进行补贴单提速；
      </p>
      <p class="rule-section">
        5.提速积分发放时间根据当前任务完成日后的最近一期固定发放日一起发放，可在进入钱包页面查看；
      </p>
      <p class="rule-section">
        6.在法律允许的范围内，武汉美美咖科技有限公司拥有本权益的最终解释权，在权益运行过程中若发现有参与者以任何不正当手段欺诈性参与的，美美咖将有权取消此用户提速卡权益的资格并追回所发放的一切积分。
      </p>
      <div class="rule-title title2">
        PLUS补贴单补贴提速卡权益Q&A
      </div>
      <div class="rule-section">
        Q：如何查看提速任务？<br>
        A：进入钱包页面，点击选择需要查看的补贴单，即可查看对应提速任务完成情况。
      </div>
      <div class="rule-section">
        Q：分享消费的金额可以累积抵扣下次提速任务吗？<br>
        A：不可以，每次提速任务补贴单多余金额不累积参与下次提速任务。
      </div>
      <div class="rule-section">
        Q：可以多个补贴单一起提速吗？<br>
        A：不可以，依次按手术完成时间进行补贴单提速，不可自行选择补贴单进行PLUS补贴提速
      </div>

    </div>
  </div>
</template>

<script>
import common from '@/assets/js/mmk_common.js'
export default {
  data () {
    return {
      base_url: common.image_resource,
    }
  },
  methods: {
    to_beauty () {
      wx.switchTab({ url: '/pages/beauty_mall/main' });
    }
  },
  props: ["doing_arr"]

}
</script>

<style lang="less" scoped>
.container {
  .speed-up {
    margin: 16px 10px 0;
    height: 146px;
    background: rgba(255, 255, 255, 1);
    border-radius: 10px;
    padding: 10px;
    box-sizing: border-box;
    position: relative;
    .code {
      vertical-align: middle;
      .left {
        float: left;
        font-size: 12px;
        font-family: "PingFangSC-Regular", "PingFang SC";
        font-weight: 400;
        color: rgba(153, 153, 153, 1);
        line-height: 16px;
      }
      .right {
        float: right;
        font-size: 12px;
        font-family: "PingFangSC-Regular", "PingFang SC";
        font-weight: 400;
        color: rgba(255, 56, 62, 1);
        line-height: 16px;
      }
    }
    .status {
      margin-top: 20px;
      display: flex;
      .progress {
        flex: 1;
        position: relative;
        .gray {
          width: 100%;
          height: 6px;
          background: rgba(235, 235, 235, 1);
          border-radius: 5px;
          position: absolute;
          top: 50%;
          transform: translateY(-50%);
        }
        .red {
          height: 6px;
          background: rgba(255, 56, 62, 1);
          border-radius: 5px;
          position: absolute;
          min-width: 10px;
          top: 50%;
          transform: translateY(-50%);
          .rocket {
            width: 20px;
            height: 20px;
            display: block;
            position: absolute;
            right: 0;
            top: 50%;
            transform: translate(50%, -50%);
          }
          .current-total {
            background: rgba(255, 139, 139, 0.1);
            border-radius: 8px;
            font-size: 10px;
            padding: 0 4px;
            font-family: "PingFangSC-Regular", "PingFang SC";
            font-weight: 400;
            color: rgba(255, 56, 62, 1);
            line-height: 16px;
            position: absolute;
            right: 0;
            bottom: 0;
            transform: translate(10px, 25px);
          }
        }
      }
      .total {
        padding: 0 6px;
        height: 20px;
        background: rgba(153, 153, 153, 1);
        border-radius: 14px;
        font-size: 12px;
        font-family: "PingFangSC-Medium", "PingFang SC";
        font-weight: 500;
        color: rgba(255, 255, 255, 1);
        line-height: 20px;
        margin-left: 10px;
      }
    }
    .detail {
      position: absolute;
      bottom: 10px;
      left: 10px;
      .tip {
        font-size: 12px;
        font-family: "PingFangSC-Regular", "PingFang SC";
        font-weight: 400;
        color: rgba(113, 113, 113, 1);
        line-height: 17px;
        vertical-align: middle;
        .num {
          color: rgba(255, 56, 62, 1);
          display: inline-block;
        }
      }
    }
    .btn {
      width: 85px;
      height: 32px;
      background: linear-gradient(
        181deg,
        rgba(249, 224, 194, 1) 0%,
        rgba(240, 182, 125, 1) 100%
      );
      border-radius: 16px 0px 0px 16px;
      position: absolute;
      bottom: 10px;
      right: 0;
      font-size: 14px;
      font-family: "PingFangSC-Medium", "PingFang SC";
      font-weight: 500;
      color: rgba(66, 30, 30, 1);
      line-height: 32px;
      padding-left: 13px;

      .icon {
        width: 16px;
        height: 16px;
        display: inline-block;
        vertical-align: middle;
        margin-left: 6px;
      }
    }
  }
  .empty {
    .img {
      display: block;
      margin: 40px auto 0;
      width: 170px;
      height: 170px;
    }
    .msg {
      font-size: 12px;
      font-family: "PingFangSC-Regular", "PingFang SC";
      font-weight: 400;
      color: rgba(153, 153, 153, 1);
      line-height: 17px;
      margin-top: 10px;
      text-align: center;
      margin-bottom: 80px;
    }
  }
  .rule {
    margin: 0 10px;
    text-align: center;
    .rule-title {
      font-size: 14px;
      padding: 0 10px;
      font-family: "PingFangSC-Medium", "PingFang SC";
      font-weight: 500;
      color: rgba(102, 102, 102, 1);
      line-height: 18px;
      margin-top: 16px;
      display: inline-block;
      &.title1 {
        position: relative;
        &::before {
          content: "";
          width: 70px;
          height: 1px;
          background: rgba(213, 213, 213, 1);
          position: absolute;
          left: 0;
          top: 50%;
          transform: translate(-100%, -50%);
        }
        &::after {
          content: "";
          width: 70px;
          height: 1px;
          background: rgba(213, 213, 213, 1);
          position: absolute;
          right: 0;
          top: 50%;
          transform: translate(100%, -50%);
        }
      }
      &.title2 {
        position: relative;
        &::before {
          content: "";
          width: 30px;
          height: 1px;
          background: rgba(213, 213, 213, 1);
          position: absolute;
          left: 0;
          top: 50%;
          transform: translate(-100%, -50%);
        }
        &::after {
          content: "";
          width: 30px;
          height: 1px;
          background: rgba(213, 213, 213, 1);
          position: absolute;
          right: 0;
          top: 50%;
          transform: translate(100%, -50%);
        }
      }
    }
    .rule-section {
      font-size: 14px;
      font-family: "PingFangSC-Regular", "PingFang SC";
      font-weight: 400;
      color: rgba(153, 153, 153, 1);
      line-height: 21px;
      margin-top: 10px;
      text-align: left;
    }
  }
}
</style>